#include "D3D9.h"

#pragma once

class CDrawFrame
{

public:

	CDrawFrame();
	~CDrawFrame(void);

private:

	IDirect3DDevice9* m_pDevice;
	IDirect3DSwapChain9* m_pSwapChain;

	RECT m_rcDest;

	int m_nSwapChainWidth;
	int m_nSwapChainHeight;

	HWND m_hWnd;
private:

	void DestroySwapChain();
	
	HRESULT CreateDevice(HWND hWnd);
	HRESULT CreateSwapChains(HWND hWnd, int nWidth, int nHeight);

public:

	void OpenDevice(HWND hWnd);
	void CloseDevice();

	HRESULT PostData(int nWidth, int nHeight, BYTE* DataForDisplay);

};

